import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
// 引入登录框插件
import loginDialogPlugin from '@plugin/loginDialogPlugin'
// 引入路由表
import { RoutesArray } from './routes'
// 引入导航守卫
import { beforeEach, afterEach } from './guards'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: RoutesArray
})

router.app = createApp()
router.app.use(loginDialogPlugin)

router.beforeEach(beforeEach)
router.afterEach(afterEach)

export default router
